package com.example.rocketmq.demo.consumer;

import com.example.rocketmq.demo.config.RocketMQConstant;
import lombok.extern.slf4j.Slf4j;
import org.apache.rocketmq.spring.annotation.RocketMQMessageListener;
import org.apache.rocketmq.spring.core.RocketMQListener;
import org.springframework.stereotype.Component;

/**
 * 基于注解方式的普通消息消费者
 */
@Slf4j
@Component
@RocketMQMessageListener(
        topic = RocketMQConstant.TOPIC_NORMAL,
        consumerGroup = "annotation-normal-consumer-group"
)
public class AnnotationNormalConsumer implements RocketMQListener<String> {

    @Override
    public void onMessage(String message) {
        log.info("注解方式-接收到普通消息: {}", message);
    }
}